package com.company.service;

import com.company.dao.CompanyinfoDao;
import com.company.entity.CompanyInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyinfoService {

    @Autowired
    private CompanyinfoDao companyinfoDao;


    public String query() {
        return companyinfoDao.findAll().get(0).getCompanyInfoZh();
    }


    public CompanyInfo list() {
        return companyinfoDao.findAll().get(0);
    }

    public void update(CompanyInfo companyInfo) {
        CompanyInfo companyInfo1 = companyinfoDao.findAll().get(0);
        companyInfo.setId(companyInfo1.getId());
        companyinfoDao.save(companyInfo);
    }
}
